home *** CD-ROM | disk | FTP | other *** search
/ The X-Philes (2nd Revision) / The X-Philes Number 1 (1995).iso / xphiles / hp48_1 / pubdom.tar / pubdom / rbj / rdl < prev    next >
Text File  |  1990-05-09  |  3KB  |  54 lines

  1. %%HP: T(3)A(D)F(.);
  2. @ RDL Ron's Directory Lister - This should (almost must) be in HOME, STD Mode
  3. @
  4. @   RBJ 4/05/90 Initial Code
  5. @       4/06/90 Local Functions, indentation
  6. @       4/11/90 Better labeling of types, DotSpace indentation
  7. @       4/12/90 List process at start rather than in the middle
  8. @       4/24/90 Use GET from list vs OBJ TO on stack: CORRECT ORDER
  9. @       4/25/90 Revise byte count, type, Use implicit ->STR behavior
  10. @       5/03/90 Display with subdirectory depth as line number, more VTYPEs
  11. @       5/07/90 Cleaned up code slightly
  12. @       5/08/90 Added print control on flag 9
  13. \<< 
  14.   IF DUP TYPE 5 ==                          @ If a list, say from HOME VARS
  15.   THEN DUP SIZE                             @ Length of list
  16.     IF DUP                                  @ If non zero ( > 0)
  17.     THEN 1 SWAP                             @ Set up loop
  18.       FOR j DUP j GET RDL                   @ Copy list, get list(j), 
  19.       NEXT DROP                             @ Drop list when done
  20.     ELSE DROP2                              @ Drop 0 and { }
  21.     END   
  22.   ELSE DUP                                  @ NOT a list, Make a copy
  23.     IF TYPE 6 ==                            @ If a name
  24.       THEN DUP                              @ Copy name for later use
  25.       DUP " " + OVER                        @ 'NAME' "NAME " 'NAME'
  26.       BYTES SWAP DROP CEIL + " " +          @ ROUND UP,'NAME' "NAME bytes "
  27.       SWAP VTYPE CASE                       @ Common object type labels
  28.         DUP  8 == THEN "Prog" END           @ In approx frequency order
  29.         DUP  0 == THEN "Real" END
  30.         DUP 15 == THEN "Dir"  END
  31.         DUP  5 == THEN "List" END
  32.         DUP  2 == THEN "Str"  END
  33.         DUP  9 == THEN "Alg"  END
  34.         DUP 11 == THEN "Grob" END
  35.         "Type " OVER +                      @ Otherwise "Type N"
  36.       END                                   @ "Name bytes "  N "type"
  37.       SWAP DROP +                           @ Drop type number N, append
  38.       ". . . . . . . . . . "                @ Indent with ". " each dir level
  39.       1 PATH SIZE 1 - 2 *                   @ Compute PATH length, string count
  40.       SUB SWAP +                            @ Extract substring and prepend 
  41.       IF 9 FS? THEN PR1 END                 @ Print if Enabled 
  42.       "\010\010" + PATH SIZE DISP           @ Display on calc line, DROP
  43.       DUP VTYPE                             @ Get vtype
  44.       IF 15 ==                              @ If a directory...
  45.       THEN DUP PATH SWAP EVAL               @ Save current path, go into dir
  46.         VARS RDL                            @ Find variables, run RDL
  47.         EVAL                                @ Evaluate prev PATH
  48.       END                                   @ End Directory processing
  49.     END                                     @ End of Type 6 (Name) Processing
  50.     DROP                                    @ Drop Name or other Object
  51.   END                                       @ End of Type 5 (List) Processing
  52. \>>
  53.  
  54.